package org.pupil.socket.client;

import org.pupil.filter.FilterData;
import org.pupil.filter.FilterResponse;
import org.pupil.filter.client.ClientBeforeFilter;
import org.pupil.socket.codec.RpcRequest;

/**
 * @Description: 服务发送方token拦截器
 * @Author: pupil
 * @Date: 2024/07/17 下午 6:38
 */
public class ClientTokenFilter implements ClientBeforeFilter {
    @Override
    public FilterResponse doFilter(FilterData<RpcRequest> filterData) {
        final RpcRequest rpcRequest = filterData.getObject();

        rpcRequest.getClientAttachments().put("token","pupil123");
        return new FilterResponse(true,null);
    }
}
